//
//  NSTimer+addition.m
//  FoodEnum
//
//  Created by xunruiIOS on 2020/7/21.
//  Copyright © 2020 xunruiIos. All rights reserved.
//

#import "NSTimer+addition.h"

@implementation NSTimer (addition)

/// 暂停
- (void)pause {
    if (!self.isValid) return;
    [self setFireDate:[NSDate distantFuture]];
}
/// 恢复
- (void)resume {
    if (!self.isValid) return;
    [self setFireDate:[NSDate date]];
}
/// 多少秒后恢复
- (void)resumeWithTimeInterval:(NSTimeInterval)time {
    if (!self.isValid) return;
    [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:time]];
}


@end
